<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    // 地图对象
    class Domain {
      constructor() {
        this.ele = document.createElement("div")
        this.setStyle()
      }

      setStyle() {
        this.ele.style.width = "600px"
        this.ele.style.height = "600px";
        this.ele.style.border = "1px solid";
        this.ele.style.margin = "0 auto";
        document.body.appendChild(this.ele);
      }
    }
    let map = new Domain()

  </script>
</body>

</html>